import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
import { requestUserTrainOrder } from '../api'

const state = {
    userTrainOrder:[]
}
const actions = {
    async stroeUserTrainOrder({commit}){
        const result = await requestUserTrainOrder()
        commit('STORE_USER_TRAINORDER',result)
    },
}
const mutations = {
    STORE_USER_TRAINORDER(state,userTrainOrder){
        state.userTrainOrder = userTrainOrder
    },
}

export default new Vuex.Store({
    state,
    actions,
    mutations,
}) 